//
//  VideoCell.m
//  SNS
//
//  Created by  on 11-12-12.
//  Copyright (c) 2011年 __MyCompanyName__. All rights reserved.
//

#import "VideoCell.h"

@implementation VideoCell

@synthesize text;

- (void)dealloc {
    [text release];
    
    [super dealloc];
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        self.text = [[[UILabel alloc] initWithFrame:CGRectMake(10, 10, 280, 0)] autorelease];
        self.text.font = [UIFont systemFontOfSize:14];
        self.text.numberOfLines = 0;
        [self.contentView addSubview:self.text];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    CGSize size = [self.text.text sizeWithFont:self.text.font
                             constrainedToSize:CGSizeMake(self.text.frame.size.width, MAXFLOAT)];
    CGRect frame = self.text.frame;
    frame.size.height = size.height;
    self.text.frame = frame;
}

- (void)prepareForReuse {
    [super prepareForReuse];
    
    self.textLabel.text = nil;
    self.text.text = nil;
    self.accessoryType = UITableViewCellAccessoryNone;
}

@end
